from method import Method, Param, KeywordParam, String, Boolean, Integer

class ApplyWatermark(Method):
    """
    Arguments:
    Integer AlbumID
    Integer WatermarkID
    """
    
    name = 'smugmug.albums.applyWatermark'
    params = (
       Param('AlbumID', Integer), 
       Param('WatermarkID', Integer)
    )
    
applyWatermark = ApplyWatermark()

class RemoveWatermark(Method):
    """
    Arguments:
    Integer AlbumID
    """

    name = 'smugmug.albums.removeWatermark'
    params = (
       Param('AlbumID', Integer),
    )
    
removeWatermark = RemoveWatermark()
        
class Get(Method):
    """
    This method returns a list of albums for a given user (either via SessionID
    or (optional) NickName). If the session is logged in as the requested
    user, a complete list of albums is returned. Otherwise, only the public
    albums are returned.

    Arguments:
    String NickName (optional)
    Boolean Heavy (optional)
    String SitePassword (optional)
    String ShareGroup (optional)
    """

    name = 'smugmug.albums.get'
    keywordParams = (
        KeywordParam('NickName', String),
        KeywordParam('Heavy', Boolean),
        KeywordParam('SitePassword', String),
        KeywordParam('ShareGroup', String)
    )
    responseKey = 'Albums'
    
get = Get()

class GetInfo(Method):
    """
    This method returns detailed information about the album specified by
    AlbumID. If the album isn't owned by the Session holder and also isn't
    public or has a password, an "invalid user" error will be returned. Note
    that many of the fields are protected for the owner's eyes only. Reduced
    information is provided to a non-owner.

    Arguments:
    Integer AlbumID
    String Password (optional)
    String SitePassword (optional)
    """

    name = 'smugmug.albums.getInfo'
    params = (
        Param('AlbumID', Integer),
    )
    keywordParams = (
        KeywordParam('Password', String),
        KeywordParam('SitePassword', String)
    )
    responseKey = 'Album'

getInfo = GetInfo()

class Create(Method):
    """
    This method will create an album in the specified category (identified by
    the CategoryID) with the specified Title. The session must be
    established with a valid login. Optionally, other arguments may be
    specified that adjust specific album properties.

    Arguments:
    String Title
    Integer CategoryID
    Integer AlbumTemplateID (optional) -- Use a pre-made album template?
      Overrides all other settings which templates can control. (default 0)
    Integer SubCategoryID (optional) -- Does this album belong to a SubCategory?
      (default 0)
    Integer CommunityID (optional) -- Is this album a part of a community?
      (default 0)
    String Description (optional) -- Text description of the contents of the
      album
    String Keywords (optional) -- Any keywords used to search or describe the
      album
    String Password (optional) -- Optional password to protect this album
    String PasswordHint (optional) -- optional, gives your visitors a hint
    Integer Position (optional) -- The album's position within it's
      Category/SubCategory, starting with 1 at the top (default 1)
    String SortMethod (optional) -- The method by which to sort the photos when
      displaying them. (default Position)
    Boolean SortDirection (optional) -- Which direction to order the SortMethod
      (default False)
    Boolean Public (optional) -- is this album public? (default True)
    Boolean Filenames (optional) -- show filenames if no caption? (default
      False)
    Boolean Comments (optional) -- allow comments? (default True)
    Boolean External (optional) -- allow external linking? (default True)
    Boolean EXIF (optional) -- Display extended camera information? (default
      True)
    Boolean Share (optional) -- Enable 'easy sharing' button and features?
      (default True)
    Boolean Printable (optional) -- Allow prints to be purchased? (default True)
    Boolean Originals (optional) -- Allow Original photos to be seen? (default
      True)
    Boolean FamilyEdit (optional) -- Allow Family to edit captions &amp;
      keywords? (default False)
    Boolean FriendEdit (optional) -- Allow Friends to edit captions &amp;
      keywords? (default False)
    Boolean HideOwner (optional) -- Mask the URL &amp; name of the owner?
    Boolean Header (optional) -- Display custom header, if any? (default False)
    Integer TemplateID (optional) -- Force a display style? (default 0)
    Boolean Larges (optional) -- Allow Large photos to be seen? (default True)
    Boolean DefaultColor (optional) -- In the cart, default to True or
      AutoColor?
    Boolean Clean (optional) -- Display album in Clean style? (default False)
    Boolean Protected (optional) -- Enable heavy image protection? (default
      False)
    Boolean Watermarking (optional) -- Enabled watermarking of photos? (default
      False)
    Boolean ProofDays (optional) -- delay printing for up to 7 business days? (default False)
    String Backprinting (optional) -- want your gallery searchable by other SmugMuggers?
    Boolean SmugSearchable (optional) -- want something printed on the backs of prints?
    Boolean WorldSearchable (optional) -- want your gallery searchable via search engines?
    
    >>> create = Create()
    >>> request = create(None, 'Test', 0)
    >>> request.method == 'smugmug.albums.create'
    True
    >>> print request.data
    >>> request.params == dict(Title='Test', CategoryID=0)
    True
    """

    name = 'smugmug.albums.create'
    params = (
        Param('Title', String),
        Param('CategoryID', Integer),
    )
    keywordParams = (
        KeywordParam('AlbumTemplateID', Integer, default=0),
        KeywordParam('SubCategoryID', Integer, default=0),
        KeywordParam('CommunityID', Integer, default=0),
        KeywordParam('Description', String),
        KeywordParam('Keywords', String),
        KeywordParam('Password', String),
        KeywordParam('PasswordHint', String),
        KeywordParam('Position', Integer, default=1),
        KeywordParam('SortMethod', String, default='Position'),
        KeywordParam('SortDirection', Boolean, default=False),
        KeywordParam('Public', Boolean, default=True),
        KeywordParam('Filenames', Boolean, default=False),
        KeywordParam('Comments', Boolean, default=True),
        KeywordParam('External', Boolean, default=True),
        KeywordParam('EXIF', Boolean, default=True),
        KeywordParam('Share', Boolean, default=True),
        KeywordParam('Printable', Boolean, default=True),
        KeywordParam('Originals', Boolean, default=True),
        KeywordParam('FamilyEdit', Boolean, default=False),
        KeywordParam('FriendEdit', Boolean, default=False),
        KeywordParam('HideOwner', Boolean),
        KeywordParam('Header', Boolean, default=False),
        KeywordParam('TemplateID', Integer, default=0),
        KeywordParam('Larges', Boolean, default=True),
        KeywordParam('DefaultColor', Boolean),
        KeywordParam('Clean', Boolean, default=False),
        KeywordParam('Protected', Boolean, default=False),
        KeywordParam('Watermarking', Boolean, default=False),
        KeywordParam('ProofDays', Integer, default=0),
        KeywordParam('Backprinting', String),
        KeywordParam('SmugSearchable', Boolean),
        KeywordParam('WorldSearchable', Boolean)
    )
    responseKey = 'Album'

create = Create()

class ChangeSettings(Method):
    """
    This method will change the settings on an album specified by AlbumID.  The
    session must be established with a valid login.  All settings are
    optional, if omitted, the current value for that setting is preserved.

    Arguments:
    Integer AlbumID
    Integer CategoryID (optional) -- Which Category does this Album belong to?
      (default 0)
    Integer SubCategoryID (optional) -- Does this album belong to a SubCategory?
      (default 0)
    Integer CommunityID (optional) -- Is this album a part of a community?
      (default 0)
    Integer HighlightID (optional) -- The ImageID of the photo to be highlighted
      (default 0)
    String Description (optional) -- Text description of the contents of the
      album
    String Keywords (optional) -- Any keywords used to search or describe the
      album
    String Password (optional) -- Optional password to protect this album
    String PasswordHint (optional) -- optional, gives your visitors a hint
    Integer Position (optional) -- The album's position within it's
      Category/SubCategory, starting with 1 at the top (default 1)
    String SortMethod (optional) -- The method by which to sort the photos when
      displaying them. (default Position)
    Boolean SortDirection (optional) -- Which direction to order the SortMethod
      (default False)
    Boolean Public (optional) -- is this album public? (default True)
    Boolean Filenames (optional) -- show filenames if no caption? (default
      False)
    Boolean Comments (optional) -- allow comments? (default True)
    Boolean External (optional) -- allow external linking? (default True)
    Boolean EXIF (optional) -- Display extended camera information? (default
      True)
    Boolean Share (optional) -- Enable 'easy sharing' button and features?
      (default True)
    Boolean Printable (optional) -- Allow prints to be purchased? (default True)
    Boolean Originals (optional) -- Allow Original photos to be seen? (default
      True)
    Boolean FamilyEdit (optional) -- Allow Family to edit captions &amp;
      keywords? (default False)
    Boolean FriendEdit (optional) -- Allow Friends to edit captions &amp;
      keywords? (default False)
    Boolean HideOwner (optional) -- Mask the URL &amp; name of the owner?
      (default False)
    Boolean Header (optional) -- Display custom header, if any? (default False)
    Integer TemplateID (optional) -- Force a display style? (default 0)
    Boolean Larges (optional) -- Allow Large photos to be seen? (default True)
    Boolean DefaultColor (optional) -- In the cart, default to True or
      AutoColor? (default True)
    Boolean Clean (optional) -- Display album in Clean style? (default False)
    Boolean Protected (optional) -- Enable heavy image protection? (default
      False)
    Boolean Watermarking (optional) -- Enabled watermarking of photos? (default
      False)
    Integer ProofDays (optional) -- delay printing for up to 7 business days?
    String Backprinting (optional) -- want something printed on the backs of
      prints?
    Boolean SmugSearchable (optional) -- want your gallery searchable by other
      SmugMuggers?
    Boolean WorldSearchable (optional) -- want your gallery searchable via
      search engines?
    """

    name = 'smugmug.albums.changeSettings'
    params = (
        Param('AlbumID', Integer),
    )
    keywordParams = (
        KeywordParam('CategoryID', Integer, default=0),
        KeywordParam('SubCategoryID', Integer, default=0),
        KeywordParam('CommunityID', Integer, default=0),
        KeywordParam('HighlightID', Integer, default=0),
        KeywordParam('Description', String),
        KeywordParam('Keywords', String),
        KeywordParam('Password', String),
        KeywordParam('PasswordHint', String),
        KeywordParam('Position', Integer, default=1),
        KeywordParam('SortMethod', String, default='Position'),
        KeywordParam('SortDirection', Boolean, default=False),
        KeywordParam('Public', Boolean, default=True),
        KeywordParam('Filenames', Boolean, default=False),
        KeywordParam('Comments', Boolean, default=True),
        KeywordParam('External', Boolean, default=True),
        KeywordParam('EXIF', Boolean, default=True),
        KeywordParam('Share', Boolean, default=True),
        KeywordParam('Printable', Boolean, default=True),
        KeywordParam('Originals', Boolean, default=True),
        KeywordParam('FamilyEdit', Boolean, default=False),
        KeywordParam('FriendEdit', Boolean, default=False),
        KeywordParam('HideOwner', Boolean, default=False),
        KeywordParam('Header', Boolean, default=False),
        KeywordParam('TemplateID', Integer, default=0),
        KeywordParam('Larges', Boolean, default=True),
        KeywordParam('DefaultColor', Boolean, default=True),
        KeywordParam('Clean', Boolean, default=False),
        KeywordParam('Protected', Boolean, default=False),
        KeywordParam('Watermarking', Boolean, default=False),
        KeywordParam('ProofDays', Integer),
        KeywordParam('Backprinting', String),
        KeywordParam('SmugSearchable', Boolean),
        KeywordParam('WorldSearchable', Boolean)
    )

changeSettings = ChangeSettings()

class ReSort(Method):
    """
    This method will re-sort all the photos inside of the album specified by
    AlbumID. Note that this is a one-time event, and doesn't apply directly
    to images added in the future by other means.

    Arguments:
    Integer AlbumID
    String By
    String Direction
    """

    name = 'smugmug.albums.reSort'
    params = (
        Param('AlbumID', Integer),
        Param('By', String),
        Param('Direction', String)
    )

reSort = ReSort()

class Delete(Method):
    """
    This method deletes the specified Album and all photos within.

    Arguments:
    Integer AlbumID
    """

    name = 'smugmug.albums.delete'
    params = (
        Param('AlbumID', Integer),
    )

delete = Delete()

class GetStats(Method):
    """
    Gets transfer statitistics for the given Album during the given Month and
    Year. SmugMug often only keeps the last few months (current + 2
    previous), but you never know. :)

    Arguments:
    Integer AlbumID
    Integer Month
    Integer Year
    """

    name = 'smugmug.albums.getStats'
    params = (
        Param('AlbumID', Integer),
        Param('Month', Integer),
        Param('Year', Integer)
    )

getStats = GetStats()

if __name__ == '__main__':
    import doctest
    doctest.testmod()
